<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <input type="text" name="" id="">

  <script>
    let inp = document.querySelector("input");
    inp.addEventListener("focus", () => {
      inp.style.backgroundColor = "red"
    })
    inp.addEventListener("blur", () => {
      inp.style.backgroundColor = ""
    })
    inp.addEventListener("change", () => {
      console.log("change事件");
    })
    inp.addEventListener("input", () => {
      console.log("input事件");
      console.log(event.data);
      console.log(event);
    })
  </script>
</body>

</html>